/**
 * Copyright &copy; 2012-2016 All rights reserved.
 */
package com.xw.app.generator.model;

import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Max;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.xw.framework.base.dao.BaseUpdatableEntity;

/**
 *@auther XiWei
 */
@Entity
@Table(name="product")
@DynamicUpdate(value=true)
@DynamicInsert(value=true)
public class Product extends BaseUpdatableEntity{

	private static final long serialVersionUID = 1L;
	
	@Length(max=250)
	@NotBlank
	private String productName; 
	@Max(2147483647)
	private Integer status; 
	private Date productDate; 
	private Time productTime; 
	private Timestamp productDatetime; 
	@Column
	private Boolean productActive; 
	@Length(max=2147483647)
	@NotBlank
	private String productTextarea; 
	
	
	public void setProductName(String productName)
	{
		this.productName = productName;
	}
	public String getProductName()
	{
		return productName;
	}
	
	public void setStatus(Integer status)
	{
		this.status = status;
	}
	public Integer getStatus()
	{
		return status;
	}
	
	public void setProductDate(Date productDate)
	{
		this.productDate = productDate;
	}
	public Date getProductDate()
	{
		return productDate;
	}
	
	public void setProductTime(Time productTime)
	{
		this.productTime = productTime;
	}
	public Time getProductTime()
	{
		return productTime;
	}
	
	public void setProductDatetime(Timestamp productDatetime)
	{
		this.productDatetime = productDatetime;
	}
	public Timestamp getProductDatetime()
	{
		return productDatetime;
	}
	
	public void setProductActive(Boolean productActive)
	{
		this.productActive = productActive;
	}
	public Boolean getProductActive()
	{
		return productActive;
	}
	
	public void setProductTextarea(String productTextarea)
	{
		this.productTextarea = productTextarea;
	}
	public String getProductTextarea()
	{
		return productTextarea;
	}
	
	
	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "system_id") })
	private SystemConfig system;
	
	public void setSystem(SystemConfig system)
	{
		this.system = system;
	}
	public SystemConfig getSystem()
	{
		return system;
	}
	
}